<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="/css/public.css" media="all" />
    <style>
        .eleTree{
            width: 350px;
            height: 500px;
            border: 1px solid #ccc;
            overflow: hidden;
            display: inline-block;
            position: absolute;
        }
        .deptName{
            height: auto;
            width: 100%;
            display: none;
            position: absolute;
            top:100%;
            background-color: #fff;
            z-index: 100;
        }
    </style>
</head>
<body>
<div class="container">
    <form class="layui-form" id="form-user-add" lay-filter="form-user">
        <div class="layui-form-item">
        <label class="layui-form-label">登录名称：</label>
        <div class="layui-input-block">
            <input class="layui-input" type="text" name="loginName" lay-verify="username" />
        </div>
    </div>
        <div class="layui-form-item">
            <label class="layui-form-label">部门名称：</label>
            <div class="layui-input-block">
                <input name="deptId"  type="hidden" />
                <input class="layui-input" type="text" name="deptName" lay-verify="required" readonly autocomplete="off" />
                <div class="eleTree deptName" lay-filter="deptNameTree"></div>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">用户名称：</label>
            <div class="layui-input-block">
                <input class="layui-input" type="text" name="userName" id="userName" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">密码：</label>
            <div class="layui-input-block">
                <input class="layui-input" type="password" name="password" id="password" lay-verify="pass" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">邮箱：</label>
            <div class="layui-input-block">
                <input class="layui-input" type="text" name="email" id="email" lay-verify="email" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">手机：</label>
            <div class="layui-input-block">
                <input class="layui-input" type="text" name="phonenumber" id="phonenumber" lay-verify="phone" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">状态：</label>
            <div class="layui-input-block">
                <div class="onoffswitch">
                    ${dict.getLayuiSwitch("status","开启|关闭","switchTest","")}
                 <!--   <input type="checkbox" th:checked="true" id="status" name="status" lay-skin="switch">-->
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">岗位：</label>
            <div class="layui-input-block">
                <#list posts as post >
                    <input name="'post['+${post_index+1}+']'" type="checkbox" lay-skin="primary"  value="${post.id}" title="${post.postName}">
                </#list>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">角色：</label>
            <div class="layui-input-block">
                <#list roles as role >
                    <input name="'role['+${role_index+1}+']'" type="checkbox" lay-skin="primary"  value="${role.id}" title="${role.roleName}" />
                </#list>

            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" id="btn-add" style="display:none"  lay-submit lay-filter="btn-add">创建</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>

    </form>
</div>
<script type="text/javascript" src="/layui/polyfill.min.js"></script>
<script type="text/javascript" src="/layui/layui.js"></script>
<script type="text/javascript" src="/layui/swotadmin.js"></script>
<script type="text/javascript">
    var prefix = "/system/user";
</script>
<script>
    layui.config({
        base: '/js/system/user/'
    }).use(['add'], function(){
        var add = layui.add;
        add.init({
            "prefix":prefix,
            "editFlag":false
        });
    });
</script>
</body>
</html>
